package cn.lhn.ridersclub.mapper;

import cn.lhn.ridersclub.entity.Account;
import cn.lhn.ridersclub.entity.AccountFollow;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface AccountFollowMapper extends BaseMapper<AccountFollow> {

    @Select("select * from account_follow where id < ${startId} and fans_id = ${accountId} order by id desc limit 20;")
    List<AccountFollow> listFollow(@Param("accountId") Long accountId, @Param("startId") Long startId);

    @Select("select * from account_follow where id < ${startId} and account_id = ${accountId} order by id desc limit 20;")
    List<AccountFollow> listFans(@Param("accountId") Long accountId, @Param("startId") Long startId);
}
